const mongoose = require("mongoose");

mongoose.connect("mongodb://127.0.0.1:27017/h5220707")
.then(() => {
    //创建结构对象
    const GoodsSchema = mongoose.Schema({
      remote_img: String,
      title: String,
      price: Number,
      url: String,
      isZY: Boolean,
      img: String,
      id: Number,
    });

    //创建模型对象
    const GoodsModel = mongoose.model("goods", GoodsSchema);

    //读取集合中的内容
    return GoodsModel.find(); 
  }
).then(data => {
  console.log(data);
})
